package com.sgb.auction.entity;

import android.text.TextUtils;

import com.swgk.core.util.DateUtils;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Time:2021/11/25
 * AUTHOR:F_Q
 * Description:
 */
public class AuctionManageListEntity  implements Serializable {

    private String no;
    private String name;
    private String applyCompany;
    private String applyCompanyName;
    private String address;
    private String region;
    private String auctionStartTime;
    private String auctionEndTime;
    private String startPrice;
    private String reason;
    private String cancelTime;
    private int version;
    private String highestPrice;
    private int state;

    public String getCancelTime() {
        if (!TextUtils.isEmpty(cancelTime)){
            String cancelTimes = DateUtils.timestampTo13Date3(Long.parseLong(cancelTime));
            return cancelTimes;
        }else {
            return "";
        }
    }

    public void setCancelTime(String cancelTime) {
        this.cancelTime = cancelTime;
    }

    public String getReason() {
        if (TextUtils.isEmpty(reason)){
            return "";
        }else {
            return reason;
        }
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getApplyCompany() {
        return applyCompany;
    }

    public void setApplyCompany(String applyCompany) {
        this.applyCompany = applyCompany;
    }

    public String getApplyCompanyName() {
        return applyCompanyName;
    }

    public void setApplyCompanyName(String applyCompanyName) {
        this.applyCompanyName = applyCompanyName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getAuctionStartTime() {
        if (!TextUtils.isEmpty(auctionStartTime)){
            String timestamp = DateUtils.timestampToDateSecond(Long.parseLong(auctionStartTime));
            return timestamp;
        }else {
            return "";
        }
    }

    public void setAuctionStartTime(String auctionStartTime) {
        this.auctionStartTime = auctionStartTime;
    }

    public String getAuctionEndTime() {
        if (!TextUtils.isEmpty(auctionEndTime)){
            String auctionendtimes = DateUtils.timestampToDateSecond(Long.parseLong(auctionEndTime));
            return auctionendtimes;
        }else {
            return "";
        }
    }

    public void setAuctionEndTime(String auctionEndTime) {
        this.auctionEndTime = auctionEndTime;
    }

    public String getStartPrice() {
        if (!TextUtils.isEmpty(startPrice)){
            BigDecimal big = new BigDecimal(startPrice);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setStartPrice(String startPrice) {
        this.startPrice = startPrice;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getHighestPrice() {
        if (!TextUtils.isEmpty(highestPrice)){
            if (!TextUtils.equals(highestPrice,"--")){
                BigDecimal big = new BigDecimal(highestPrice);
                big = big.stripTrailingZeros();
                return big.toPlainString()+"元";
            }else {
                return highestPrice;
            }
        }else {
            return "";
        }
    }

    public void setHighestPrice(String highestPrice) {
        this.highestPrice = highestPrice;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

}
